<?php
/* @var $this SiteController */
/* @var $model ContactForm */
/* @var $form CActiveForm */

$this->pageTitle=Yii::app()->name . ' - 登录';
$this->breadcrumbs=array(
	'登录',
);
?>


<style>
span.required{color: red;}
div.errorMessage{color: red;margin-top: 3px;}
</style>
            <div class="form">
                <h1>用户登录</h1>
            
               
                <?php $form = $this -> beginWidget('CActiveForm',
                                array(
                                		'id'=>'login_form',
                                        'enableClientValidation'=>true,
                                        'clientOptions'=>array(
                                            'validateOnSubmit'=>true,
                                        ),
                                )
                        ); ?>
                    <table align="left" border="0" cellpadding="3" cellspacing="5" width="100%">
                        <tbody>
                            <tr>
                                <td width="12%" style="text-align: right;">
                                    <?php echo $form->labelEx($user_login,'username'); ?>
                                </td>
                                <td width="88%">
                                    <div style=" float: left;">
                                    <?php echo $form->textField($user_login,'username',array('size'=>25,'class'=>'inputBg')); ?>
                                    </div>
                                    <?php echo $form->error($user_login,'username'); ?>
                                </td>
                            </tr>
                            <tr>
                                <td style="text-align: right;">
                                    <?php echo $form->labelEx($user_login,'password'); ?>
                                </td>
                                <td>
                                    <div style=" float: left;">
                                    <?php echo $form->passwordField($user_login,'password',array('size'=>25,'class'=>'inputBg')); ?>
                                    </div>
                                    <?php echo $form->error($user_login,'password'); ?>
                                </td>
                            </tr>
                            <tr>
                                <td style="text-align: right;">
                                    <?php echo $form->labelEx($user_login, 'verifyCode'); ?>
                                </td>
                                <td>
                                    <div style=" float: left;">
                                    <?php echo $form->textField($user_login, 'verifyCode',array('size'=>10,'class'=>'inputBg','maxlength'=>4)); ?>
                                    <!--显示验证码图片/使用小物件显示验证码-->
                                    <?php $this -> widget('CCaptcha',array('showRefreshButton'=>false,'clickableImage'=>true,'imageOptions'=>array('alt'=>'点击换图','title'=>'点击换图','style'=>'cursor:pointer'))); ?>
                                    </div>
                                    <?php echo $form->error($user_login,'verifyCode'); ?>
                                </td>
                            </tr>
                            <tr>
                                <td style="text-align: right;"><div align="right"><?php echo $form->checkBox($user_login,'rememberMe');?></div></td>
                                <td><?php echo $form->labelEx($user_login,'rememberMe');?></td>
                            </tr>
                            <tr>
                                <td>&nbsp;</td>
                                <td>
                                    <input name="submit" value="登录" class="us_Submit" type="submit" />
                                    &nbsp;&nbsp;&nbsp;&nbsp;<a href="./index.php?r=user/register">还没注册？</a>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                <?php $this->endWidget(); ?>
                <div class="blank"></div>
          
            </div>
<script language="javascript">
$(document).ready(function(){
    var img = new Image;
        img.onload=function(){
            $('#yw0').trigger('click');
        }
        img.src = $('#yw0').attr('src');  //这段js解决yii验证码不刷新
});
</script>